package cn.pet.service.manage.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import java.time.LocalDate;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.multipart.MultipartFile;

/**
 * <p>
 * 商品信息表
 * </p>
 *
 * @author 
 * @since 2023-02-11
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class PetGoods implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 商品ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 商品名称
     */
    private String name;

    /**
     * 商品发布时间
     */
//    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDate pubDate;

    /**
     * 商品图片
     */
    private String picture;

    /**
     * 商品价格
     */
    private Double price;

    /**
     * 商品优惠价格
     */
    private Double preferencePrice;

    /**
     * 销售量
     */
    private Long sale;

    /**
     * 商品数量
     */
    private Long amount;

    /**
     * 商品描述信息
     */
    private String intro;

    /**
     * 备注
     */
    private String remark;

    /**
     * 商品类别
     */
    private Integer typeId;

    /**
     * 商品状态 0：正在使用，1：已下架
     */
    private Integer status;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @TableField(exist = false)
    private MultipartFile file;

    public static final String ID = "id";

    public static final String NAME = "name";

    public static final String PUB_DATE = "pub_date";

    public static final String PICTURE = "picture";

    public static final String PRICE = "price";

    public static final String PREFERENCE_PRICE = "preference_price";

    public static final String SALE = "sale";

    public static final String AMOUNT = "amount";

    public static final String INTRO = "intro";

    public static final String REMARK = "remark";

    public static final String TYPE_ID = "type_id";

    public static final String CREATE_TIME = "create_time";

    public static final String UPDATE_TIME = "update_time";

}
